﻿using System.ComponentModel;
using System.Drawing;

namespace Agnes.Core
{
    /// <summary>
    /// 所有文档视图(相应的ViewModel)都必须实现该接口
    /// </summary>
    public interface IDocumentPanel : INotifyPropertyChanged
    {
        /// <summary>
        /// 文档内容
        /// </summary>
        object Content { get; }

        /// <summary>
        /// 文档标题
        /// </summary>
        string Caption { get; }

        /// <summary>
        /// 文档标题图标
        /// </summary>
        Image CaptionImage { get; }

        /// <summary>
        /// 数据是否修改过
        /// </summary>
        bool IsDirty { get; }

        /// <summary>
        /// 数据是否完整
        /// </summary>
        bool IsVaild { get; }

        /// <summary>
        /// 保存文档
        /// </summary>
        void Save();

        /// <summary>
        /// 取消对文档的修改
        /// </summary>
        void Cancel();

        /// <summary>
        /// 在文档视图关闭前
        /// 有2种情况会系统会调用方法：
        /// 1.按文档关闭按钮前
        /// 2.关闭重新加载解决方案前
        /// </summary>
        void PreViewClose(object sender, CancelEventArgs e);
    }
}
